package main 

import (
	"fmt"
	"reflect"
)

type Person struct {
	Name string
	Age int
}

func main() {
	var a interface{}
	a = 10
	var t = reflect.TypeOf(a)
	fmt.Println(t)
	a = "hello"
	t = reflect.TypeOf(a)
	fmt.Println(t)

	var p = Person{Name: "tom", Age: 18}
	t = reflect.TypeOf(p)
	fmt.Println(t)

	// 获取指针类型
	var h = 10
	fmt.Println(reflect.TypeOf(&h))
}